
//收费管理

import request from "@/utils/request";

// 引入qs模块，用来序列化post类型的数据，后面会提到
import QS from "qs";


// 收费项目-获取列表 分页
export function getChargeList (params) {
    return request({
        url: `/finance/financeitems/list`,
        method: "get",
        params,
    });
}

// 收费项目 - 新增
export function createCharge (data) {
    return request({
        url: `/finance/financeitems/save`,
        method: "post",
        data,
    });
}

// 收费项目 - 修改
export function upDataCharge (data) {
    return request({
        url: `/finance/financeitems/update`,
        method: "post",
        data,
    });
}




// 收费标准-获取列表 分页
export function getFinancecriterionList (params) {
    return request({
        url: `/finance/financecriterion/list`,
        method: "get",
        params,
    });
}

// 收费标准 - 新增
export function createFinancecriterion (data) {
    return request({
        url: `/finance/financecriterion/save`,
        method: "post",
        data,
    });
}

// 收费标准 - 修改
export function upDataFinancecriterion (data) {
    return request({
        url: `/finance/financecriterion/update`,
        method: "post",
        data,
    });
}

// 收费标准-删除
export function daleteFinancecriterion (data) {
    return request({
        url: `finance/financecriterion/delete`,
        method: "post",
        data,
    });
}

// 收费标准-停用
export function stopFinancecriterion (params) {
    return request({
        url: `/finance/financecriterion/updateEnableFlag`,
        method: "get",
        params,
    });
}


// 结算方式-获取列表 分页
export function getFinancesettlement (params) {
    return request({
        url: `/finance/financesettlement/list`,
        method: "get",
        params,
    });
}

// 结算方式 - 新增
export function createFinancesettlement (data) {
    return request({
        url: `/finance/financesettlement/save`,
        method: "post",
        data,
    });
}

// 结算方式 - 修改
export function upDataFinancesettlement (data) {
    return request({
        url: `/finance/financesettlement/update`,
        method: "post",
        data,
    });
}

// 结算方式-删除
export function daleteFinancesettlement (data, id) {
    return request({
        url: `/finance/financesettlement/delete/${id}`,
        method: "post",
        data,
    });
}

// 收据抬头-获取列表 分页
export function getFinancetitle (params) {
    return request({
        url: `/finance/financetitle/list`,
        method: "get",
        params,
    });
}

// 收据抬头 - 新增
export function createFinancetitle (data) {
    return request({
        url: `/finance/financetitle/save`,
        method: "post",
        data,
    });
}

// 收据抬头 - 修改
export function upDataFinancetitle (data) {
    return request({
        url: `/finance/financetitle/update`,
        method: "post",
        data,
    });
}

// 收据抬头-删除
export function daleteFinancetitle (data, id) {
    return request({
        url: `/finance/financetitle/delete/${id}`,
        method: "post",
        data,
    });
}

// 周期账单-获取列表 分页
export function getFinancebillbatch (params) {
    return request({
        url: `/finance/financebillbatch/list`,
        method: "get",
        params,
    });
}

// 周期账单 - 新增
export function createFinancebillbatch (data) {
    return request({
        url: `/finance/financebillbatch/save`,
        method: "post",
        data,
    });
}


// 应收账单 - list   作废账单也用这个 state传 1  //1 作废   2 已收账单   3应收账单
export function getFinancebilldetail (params) {
    return request({
        url: `/finance/financebilldetail/list`,
        method: "get",
        params,
    });
}

// 应收账单 - 去收款 - 账单明细
export function getBillDetailed (data) {
    return request({
        url: `/finance/financebilldetail/getGenerateMakeCollectDetail`,
        method: "post",
        data,
    });
}

// 应收账单 - 去收款 - 保存
export function saveBillDetailed (data) {
    return request({
        url: `/finance/financebilldetail/saveGenerateMakeCollectDetail`,
        method: "post",
        data,
    });
}

// 应收账单 - 添加临时账单
export function saveTemporary (data) {
    return request({
        url: `/finance/financebilldetail/saveTemporary`,
        method: "post",
        data,
    });
}


// 应收账单 - 减免
export function saveFree (data) {
    return request({
        url: `/finance/financebilldetail/saveFree`,
        method: "post",
        data,
    });
}


// 应收账单 - 作废
export function saveCancleBill (data) {
    return request({
        url: `/finance/financebilldetail/saveCancle`,
        method: "post",
        data,
    });
}



// 红冲/实收 账单 - 分页查询  统计报表/实收明细也用这个接口
export function getPaiedbill (params) {
    return request({
        url: `/finance/paiedbill/findPage`,
        method: "get",
        params,
    });
}


// 红冲/实收 - 红冲
export function getHongchong (params) {
    return request({
        url: `/finance/paiedbill/reverse`,
        method: "get",
        params,
    });
}

// 红冲/实收 - 收款备注
export function updateRemark (params) {
    return request({
        url: `/finance/paiedbill/updateRemark`,
        method: "get",
        params,
    });
}




//作废账单 - 列表   后台未上传   使用   getFinancebilldetail  这个接口
export function getVoid (params) {
    return request({
        url: `/finance/bill/findPagek`,
        method: "get",
        params,
    });
}


//预存账户 - 列表   
export function getFinanceprepaiditems (data) {
    return request({
        url: `/finance/financeprepaiditems/list`,
        method: "post",
        data,
    });
}

//预存账户 - 新增或修改    type=1 退   type=0 加
export function saveFinanceprepaiditems (params) {
    return request({
        url: `/finance/financeprepaiditems/changeMoney`,
        method: "get",
        params,
    });
}

// 预存账户-删除
export function daleteFinanceprepaiditems (data) {
    return request({
        url: `/finance/financeprepaiditems/delete`,
        method: "post",
        data,
    });
}

//预存冲抵 明细
export function getFindPrepaidList (params) {
    return request({
        url: `/finance/paiedbill/findPrepaidList`,
        method: "get",
        params,
    });
}

